In database systems such as DB2™ databases, catalog tables and directory tables such as the SYSCOPY table and SYSLGRNX table store information needed by the database system for recovery. For example, information related to certain command execution and the times of execution are stored in these two tables for every tablespace defined. The two tables, thus, accumulate many records for every tablespace in a DB2™ system.
As these two tables grow, any process accessing or using the tables will consume more and more resources. For instance, making image copy of tablespaces that correspond to these tables, and reorganization of these tables will take longer. Scanning the tables will consume more CPU and I/O operations. Other negative system impacts associated with large catalog and directory tables exist. Thus, it is desirable to delete old and obsolete entries from these two tables on a regular basis.
In these database systems, however, catalog and directory tables as those described above are considered as objects that are critical for the operation and function of the databases, and thus, the database systems do not permit accesses to the tables using SQL operations such as INSERT, DELETE, and UPDATE. Although special utilities exist for cleaning up these tables, the utilities need to be purchased separately by the users of the database systems. MODIFY RECOVERY utility from IBM is one example of a separately packaged utility that deletes SYSCOPY rows and SYSLGRNX entries based on age or date. Thus, for example, users may need to purchase a separate utility in order to clean up their directory table. Accordingly, a method and system is needed to be able to delete one or more rows from a database directory.